<?php

namespace App\Admin\Model;

use App\Admin\Model\{
    Duanzu,
    InvitationCeremony,
    Rebate,
    Cash
};

class Users extends Duanzu
{
    //表名
    protected $table = 'member';
    //主键
    protected $primaryKey = 'uid';
    //粉丝
    public function invitation_ceremony()
    {
        return $this->hasMany(InvitationCeremony::class, 'invite_uid');
    }

    public function rebate_log()
    {
        return $this->hasMany(Rebate::class, 'uid');
    }

    public function rebate_a_log()
    {
        return $this->hasMany(Rebate::class, 'a_uid', 'uid');
    }

    public function rebate_b_log()
    {
        return $this->hasMany(Rebate::class, 'b_uid', 'uid');
    }

    public function cash()
    {
        return $this->hasMany(Cash::class, 'uid');
    }
}
